<!doctype html>
<html lang="en">
 <head>
  <meta charset="UTF-8">
  <meta name="Generator" content="EditPlus®">
  <meta name="Author" content="">
  <meta name="Keywords" content="">
  <meta name="Description" content="">
  <title>angularJs入门Demo-4 控制器</title>
  <script src="angular.min.js"></script>
  <script>
		//建立模块
		var app=angular.module("myApp",[]);
		//创建控制器 $scope就是控制层和视图层之前交换数据的桥梁
		app.controller("myController",function($scope){
			
			$scope.add=function(){
				return  parseInt($scope.x)+parseInt($scope.y);
			}
			
		});
  </script>
 </head>
 <body ng-app="myApp" ng-controller="myController">
	第一个数：<input ng-model="x"> 第二个数:<input ng-model="y">
	{{add()}}
 </body>
</html>